<template>
  <p>{{ arr }}</p>
  <button @click="arr.push(1)">更新数组</button>
  <input type="text" ref="input1" />
</template>

<script>
export default {
  name: 'Demo',
}
</script>
<script setup>
import { watch, ref, onBeforeMount } from 'vue'
let arr = ref([])
const input1 = ref(null)
console.log('input1', input1)
onBeforeMount(() => {
  console.log('input123', input1)
})
watch(
  arr,
  (newValue, oldValue) => {
    console.log('数组更新了', newValue, oldValue)
  },
  { deep: true }
)
</script>

<style></style>
